<?php

namespace app\crontab\task;



use app\admin\model\LeescoreOrder;

/**
 * 众包费
 *
 * @icon fa fa-circle-o
 */
class OrderCheck extends Common
{
    public function __construct(array $params = [])
    {
        parent::__construct($params);
    }

    public function consumer() {
        try {
            //检测订单 订单如果5分钟不支付 那么自动无效增加库存
            $where['pay'] = 0;
            $where['createtime'] = ['lt', time() - 5*60]; //5分钟未支付自动取消订单

            LeescoreOrder::where($where)->chunk(1000, function ($orders) {

            });
        } catch (\Exception $e) {
            doLog($e->getMessage(), 'ordercheck');
        }

        echo 'finish';
    }

}
